package demo;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Administrator
 * Date: 2023-07-05
 * Time: 12:14
 */
public class Test {
    public void merge(int A[],int m,int B[],int n){
        int i = m-1;
        int j = n-1;
        int k = m+n-1;

        while (i >= 0 && j >= 0){
            if(A[i] <= B[j]){
                A[k] = B[j];
                k--;
                j--;
            }else{
                A[k] = A[i];
                k--;
                i--;
            }
        }
        while (j >= 0){
            A[k] = B[j];
            k--;
            j--;
        }
        while (i >= 0){
            A[k] = A[i];
            k--;
            i--;
        }
    }
    public static String func(String s){
        StringBuilder str = new StringBuilder();
        int[] arry = new int[127];
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if(arry[ch] == 0){
                str.append(ch);
                arry[ch] = 1;
            }
        }
        return str.toString();
    }
    public static void main2(String[] args) {
        Scanner in = new Scanner(System.in);
        while (in.hasNextLine()){
            String str = in.nextLine();
            String ret = func(str);
            System.out.println(ret);
        }
    }
    public static void main1(String[] args) {
        System.out.println("before");
        try{
            System.out.println(10 / 0);
        }catch(ArithmeticException e){
            e.printStackTrace();
            System.out.println("我捕获到了这个异常:ArithmeticException");
        }
        System.out.println("after");

    }
}
